from app.rest_mock_main import add_endpoint, app,load_endpoints

if __name__ == '__main__':
    # 示例：添加测试接口
    add_endpoint('GET', 'api/user',
                 {'id': 1, 'name': '测试用户'},
                 headers={'Content-Type': 'application/json'})
    #
    # add_endpoint('POST', 'api/login',
    #              {'token': 'abcd1234'},
    #              status_code=201)

    # 在应用启动时加载 endpoints
    load_endpoints()
    # 启动服务
    app.run(host='0.0.0.0', port=5000, debug=True)
    print("start success")